module ActiveScaffold::DataStructures
  class Column
    def ui_type
      @ui_type || ui_type_default
    end

    def ui_type_default
      if name.to_s.include?("phone") || name.to_s == "fax"
        if name.to_s.include?("ext")
          size_in_edit = 10
          max_length = 10
          self.ui_type = :phone_ext
        else
          size_in_edit = 12
          max_length = 12
          self.ui_type = :phone
        end
      else
        self.ui_type = @column.type
      end
    end
    
    attr_accessor :html_options
    def html_options
      @html_options || {}
    end
            
  end
end
